import axios from 'axios'
// import env from './env'

const service = axios.create({
  // baseURL: env.baseURL,
  baseURL:'/api',
  timeout: 5000
})


service.interceptors.request.use(

)

service.interceptors.response.use(
  response => {
    const res = response.data
    console.log(res);
    if (res.status == 0) {
      return res.data
    } else if (res.status == 10) {
      window.location.href = '/#/login'
    } else {
      alert(res.msg)
    }
  }
)



export default service
